﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>郑州爱普锐在线考试系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../static/css/font.css">
    <link rel="stylesheet" href="../static/css/weadmin.css">
    <style type="text/css">
        .layui-card-body {
            /* padding: 10px 15px; */
            padding: 0px;
        }
    </style>
</head>
<body>
    <div class="weadmin-nav">
        <span class="layui-breadcrumb" style="visibility: visible;">
            <a href="#">首页</a><span lay-separator="">/</span>
            <a href="#">我的桌面</a>
        </span>
        <a class="layui-btn layui-btn-sm" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
            <i class="layui-icon" style="line-height:30px">&#x1002;</i>
        </a>
    </div>
    <div class="weadmin-body">
        <blockquote class="layui-elem-quote">欢迎使用郑州爱普锐在线考试系统！</blockquote>
        <div class="layui-fluid" style="overflow: hidden;">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            最新通知
                            <i class="layui-icon" style="color: #FF5722;">&#xe756;</i>
                            <!--<a href="#" style="float:right;" onclick="javascript: void (0);"><i class="layui-icon layui-icon-next" title="点此查看更多"></i></a>-->
                        </div>
                        <div class="layui-card-body layui-text weadmin-text">
                            <strong>时间</strong>：<span id="MsgAddTime"></span><br />
                            <strong>标题</strong>：<span id="MsgTitle"></span><br />
                            <strong>内容</strong>：<span id="MsgContent"></span>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">考试信息</div>
                        <div class="layui-card-body">
                            <table id="examlist" lay-filter="examlist"></table>
                        </div>
                    </div>
                </div>
            </div>
            <!--<div class="layui-row layui-col-space15">
                <div class="layui-col-md8">
                    <div class="layui-card">
                        <div class="layui-card-header">文件管理</div>
                        <div class="layui-card-body">
                            <table class="layui-table">
                                <colgroup>
                                    <col width="150">
                                    <col width="200">
                                    <col>
                                </colgroup>
                                <thead>
                                    <tr>
                                        <th>昵称</th>
                                        <th>加入时间</th>
                                        <th>签名</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td>贤心</td>
                                        <td>2016-11-29</td>
                                        <td>人生就像是一场修行</td>
                                    </tr>
                                    <tr>
                                        <td>贤心</td>
                                        <td>2016-11-29</td>
                                        <td>人生就像是一场修行</td>
                                    </tr>
                                    <tr>
                                        <td>贤心</td>
                                        <td>2016-11-29</td>
                                        <td>人生就像是一场修行</td>
                                    </tr>
                                    <tr>
                                        <td>贤心</td>
                                        <td>2016-11-29</td>
                                        <td>人生就像是一场修行</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md4">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            个人信息
                        </div>
                        <div class="layui-card-body layui-text weadmin-text">
                            <p>Layui发版以来一直受到不少猿的推崇，作为其中的小白，我也一直在推崇和学习中挣扎，WeAdmin无他，也只是小白实操的一个记录。</p>
                        </div>
                    </div>
                </div>
            </div>-->
        </div>
    </div>
    <script type="text/javascript" src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/html" id="tool">
        <a class="layui-btn layui-btn-xs" lay-event="detail">详情</a>
    </script>
    <script type="text/javascript">
        layui.use(['table', 'jquery', 'layer'], function () {
            var table = layui.table,
                $ = layui.jquery,
                layer = layui.layer;
            $.support.cors = true;
            $.ajaxSetup({
                cache: false,
                headers: {
                    "userid": JSON.parse(window.localStorage.authInfo).UserId,
                    "signtoken": JSON.parse(window.localStorage.authInfo).SignToken,
                },
            })
            $.ajax({
                url: ApiUrl + "MessageInfo/GetLatestMessageForWelcome",
                type: 'get',
                dataType: 'json',
                data: {},
                success: function (data) {
                    if (data.StatusCode == 200) {
                        if (data.Count > 0) {
                            $("#MsgAddTime").text(data.Data.MsgAddTime)
                            $("#MsgTitle").text(data.Data.MsgTitle)
                            $("#MsgContent").text(data.Data.MsgContent)
                        }
                    }
                }
            });
            table.render({
                id: "examlist",
                elem: '#examlist',
                url: ApiUrl + 'ExamSearch/GetList', //数据接口,
                where: { top: 5 },
                cellMinWidth: 80,
                cols: [
                    [
                        //{ field: 'DepName', title: '考试部门' },
                        { field: 'EmpName', title: '考试人员'  },
                        { field: 'EUExamStream', title: '流水号' },
                        { field: 'EUFullMarks', title: '满分' },
                        { field: 'EUMark', title: '得分' },
                        { field: 'EUStart', title: '开始时间'  },
                        { field: 'EUEnd', title: '结束时间' },
                        { field: 'EUTime', title: '考试时长(分)' },
                        {
                            field: 'EUComplete', title: '是否结束', templet: function (d) {
                                return d.EUComplete == "0" ? "否" : "是";
                            }
                        },
                        { fixed: 'right', title: '操作', align: 'center', toolbar: '#tool', width: 100 }
                    ]
                ],
                parseData: function (res) { //res 即为原始返回的数据
                    return {
                        "code": res.StatusCode, //解析接口状态
                        "msg": res.Info, //解析提示文本
                        "count": res.Count, //解析数据长度
                        "data": res.Data //解析数据列表
                    };
                },
                //done: function (res, curr, count) {//res为parseData映射后的数据
                //    if (res.code == 403) {
                //        top.layer.alert(data.Info + ",请重新登录！", { closeBtn: 0 }, function () {
                //            top.location.href = "http://" + top.location.host + "/login.html";
                //        })
                //    }
                //},
                response: { statusCode: 200 },//规定成功的状态码，默认：0
                event: true,
                defaultToolbar: []
            });
            //监听工具条
            table.on('tool(examlist)', function (obj) {
                var trdata = obj.data;
                var layEvent = obj.event;
                if (layEvent === 'detail') {
                    var detail = layer.open({
                        type: 2,
                        title: "考试详情",
                        area: ['800px', '100%'],
                        fixed: false,
                        maxmin: true,
                        content: './search/examresult_detail.html?EUID=' + trdata.EUID,
                    });
                    layer.full(detail);
                }
            });
        });
    </script>
</body>
</html>